<?php

Route::middleware([
    \App\Http\Middleware\PartnerGateway::class,
    \App\Http\Middleware\ApiResponse::class,
])->group(function () {
    # 权益码兑换（小猪）
    // 权益兑换码查询
    Route::get('keys/query', 'AssetKeyController@query');
    // 权益兑换码使用
    Route::post('keys/consume', 'AssetKeyController@consume');
});

Route::middleware([
    \App\Http\Middleware\HezhiGateway::class,
])->group(function () {
    # 交易所对接（禾只商城）
    // 查询商品存证
    Route::get('agent_{agent_id}/product_tokens', 'HezhiController@listProductTokens');
    // 用户注册
    Route::post('agent_{agent_id}/register', 'HezhiController@register');
    // 交易划转
    Route::post('agent_{agent_id}/trade', 'HezhiController@trade');
    //检查资产状态
    Route::post('agent_{agent_id}/check', 'HezhiController@checkForTrade');
});

Route::prefix('tzs')->middleware([
    \App\Http\Middleware\TZSGateway::class,
])->group(function () {
    # 天知所资产中心对接
    // 用户注册
    Route::post('agent_{agent_id}/register', 'TZSController@register');
    // 查询商品存证
    Route::post('agent_{agent_id}/product_tokens', 'TZSController@listProductTokens');
    // 交易划转
    Route::post('agent_{agent_id}/trade', 'TZSController@trade');
    //检查资产状态
    Route::post('agent_{agent_id}/check', 'TZSController@checkForTrade');
});

Route::prefix('hjs')->middleware([
    \App\Http\Middleware\HJSGateway::class,
])->group(function () {
    # 交易所对接（合交所）
    // 用户注册
    Route::post('agent_{agent_id}/register', 'HJSController@register');

    // 查询商品存证
    Route::get('agent_{agent_id}/product_tokens', 'HJSController@listProductTokens');

    // 交易划转
    Route::post('agent_{agent_id}/batch_transfer', 'HJSController@batchTransfer');

    // 交易划转结果查询
    Route::post('agent_{agent_id}/batch_query', 'HJSController@batchQuery');
});
